<?php
	function __autoload($class_name)
	{
		include_once('../classes/'.strtolower($class_name).'.php');
	}
    
    $Loi = false;
	
    $TenLoaiSanPhamCap1 = $_POST['TenLoaiSanPhamCap1'];
    $MaLoaiSanPham = $_POST['MaLoaiSanPham'];
		    
    $loaisanphamcap1 = new loaisanphamc1bs();
    $loaisanphamcap1->TenLoaiSanPhamCap1 = $TenLoaiSanPhamCap1;
    $loaisanphamcap1->MaLoaiSanPham = $MaLoaiSanPham;
    $isset = $loaisanphamcap1->issetType();
    
    if($isset[0]['SoDong'] > 0)
        $Loi = true;
    
    if($Loi == false)
    {
        $loaisanphamcap1->add();
        echo "yes";
    }
    else
    {
        echo "no";
    }
?>